package com.zyz.E_面向对象.G_this;

/**
 * @author: vick
 * @Date: 2025/3/14
 * @Description:
 * @version: 1.0
 */
public class Person {
    private String name;

    public Person() {
    }

    public Person(String name) {
        //this.name代表的是属性的 name
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public void eat(){
        //在同一个类中，方法之间可以相互调用，this.可以省略不写！
        drink();
        this.drink();
        System.out.println("吃");
    }


    public void drink(){
        System.out.println("喝");
    }
}
